<?php defined('IN_SYS') or die ('Direct Access to this location is not allowed.'); ?>
<?php
/**
 * 显示侧边栏
 *
 * @param string $type
 */
function get_sidebar($type) {
	switch ($type) {
		case 'dashboard':
		    echo <<<EOT
			<li><h3><a href="admin.php?ctl=dashboard" class="house">Dashboard</a></h3>
			    <ul>
			        <li><a href="./" class="online">Browse Blog</a></li>
			        <li><a href="https://www.google.com/analytics/home/?hl=zh-CN" class="promotions">Analytics</a></li>
			        <li><a href="admin.php?ctl=search" class="search">Search</a></li>
			    </ul>
			</li>
EOT;
            break;
        case 'posts':
            echo <<<EOT
            <li><h3><a href="admin.php?ctl=posts" class="invoices">Posts</a></h3>
			    <ul>
			        <li><a href="admin.php?ctl=posts" class="invoices">Posts</a></li>
			        <li><a href="admin.php?ctl=posts&act=new" class="pagenew">New post</a></li>
			        <li><a href="admin.php?ctl=category" class="folder">Categories</a></li>
			        <li><a href="admin.php?ctl=category&act=new" class="add">Add Category</a></li>
			        <li><a href="admin.php?ctl=tags" class="modules_manage">Tags</a></li>
			    </ul>
			</li>
EOT;
            break;
        case 'media':
            echo <<<EOT
            <li><h3><a href="dashboard.php" class="house">Dashboard</a></h3>
                <ul>
                    <li><a href="./" class="online">Browse Blog</a></li>
                    <li><a href="https://www.google.com/analytics/home/?hl=zh-CN" class="promotions">Analytics</a></li>
                    <li><a href="search.php" class="search">Search</a></li>
                </ul>
            </li>
EOT;
            break;
        case 'comments':
            echo <<<EOT
            <li><h3><a href="dashboard.php" class="house">Dashboard</a></h3>
                <ul>
                    <li><a href="./" class="online">Browse Blog</a></li>
                    <li><a href="https://www.google.com/analytics/home/?hl=zh-CN" class="promotions">Analytics</a></li>
                    <li><a href="search.php" class="search">Search</a></li>
                </ul>
            </li>
EOT;
            break;
        case 'links':
            echo <<<EOT
            <li><h3><a href="dashboard.php" class="house">Dashboard</a></h3>
                <ul>
                    <li><a href="./" class="online">Browse Blog</a></li>
                    <li><a href="https://www.google.com/analytics/home/?hl=zh-CN" class="promotions">Analytics</a></li>
                    <li><a href="search.php" class="search">Search</a></li>
                </ul>
            </li>
EOT;
            break;
        case 'tools':
            echo <<<EOT
			<li><h3><a href="admin.php?ctl=tools" class="modules">Tools</a></h3>
			    <ul>
			        <li><a href="admin.php?ctl=tools&mod=twitter" class="modules_manage">Twitter</a></li>
			        <li><a href="admin.php?ctl=tools&mod=fanfou" class="modules_manage">Fanfou</a></li>
			        <li><a href="admin.php?ctl=tools&mod=delicious" class="modules_manage">Delicious</a></li>
			        <li><a href="admin.php?ctl=tools&mod=picasa" class="modules_manage">Picasa</a></li>
			    </ul>
			</li>
EOT;
            break;
        case 'settings':
            echo <<<EOT
            <li><h3><a href="admin.php?ctl=settings" class="manage">Settings</a></h3>
                <ul>
                    <li><a href="admin.php?ctl=settings" class="manage_page">Options</a></li>
                    <li><a href="admin.php?ctl=settings&type=html" class="folder">Html</a></li>
                    <li><a href="admin.php?ctl=settings&type=feeds" class="rss">Feeds</a></li>
                </ul>
            </li>
EOT;
            break;
	}
}

/**
 * 显示侧边栏清单
 *
 * @param array $types
 */
function sidebar_list($types) {
	foreach ($types as $type) {
		get_sidebar($type);
	}
}
?>